package Creating_Observables

import (
	"errors"
	"fmt"
	"github.com/reactivex/rxgo/v2"
)

// 创建一个可观测的,吐不出东西,但正常终止。
func Demo_Empty() {
	observable := rxgo.Empty()
	fmt.Println(observable)
}

// 创建一个可观测的,吐不出东西,不会终止。
func Demo_Never() {
	observable := rxgo.Never()
	fmt.Println(observable)
}

// Create an Observable that emits no items and terminates with an error.
func Demo_Throw() {
	observable := rxgo.Thrown(errors.New("foo"))
	fmt.Println(observable)
}
